<template>
	<!--抬头列表-->
	<view class="content">
		<view class="contenter">
			<!--抬头列表-->
			<!--抬头列表开始-->
			<view class="indexList" v-for="(item, riseLists) in riseLists" @click="toDetail(item.id)">
				<view class="ad-indexList">
					<view class="ad-List">
						<view class="ad-List-text">
							抬头名称:
							<view class="list-text-01" v-model="einName">{{ item.name }}</view>
						</view>
						<view class="ad-List-text">
							地址:
							<view class="list-text-01" v-model="lnvoiceEin">{{ item.address }}</view>
						</view>
					</view>
				</view>
			</view>
			<!--抬头列表结束-->
			<navigator url="./modify"></navigator>
		</view>
		<view class="head">
			<view class="ad-head" @click="gorise">
				<image src="../../../../../static/icon/add1.png"/>
			</view>
		</view>
		<view class="bgimge" v-if="riseLists.length<=0">
			<image
			        src="/static/icon/empty5.png"
			>
			</image>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				riseLists: {}, //抬头列表
			}
		},
		onLoad() {
			var me = this;
			var userinfo = uni.getStorageSync("user")
			//打印数值
			console.log('user' + JSON.stringify(userinfo));
			uni.request({
				url: me.$ServerUrl + '/invoice/api/header/getInviceHeaderListByCustomerId', //根据用户ID显示抬头
				data: {
					customerId: userinfo.id
				},
				header: {
					'content-type': 'application/x-www-form-urlencoded' // 默认值JSON格式
				},
				method: 'GET',
				success: res => {
					console.log('抬头数据' + JSON.stringify(res));
					me.riseLists = res.data;
					console.log(me.riseLists);
				}
			});
		},
		methods:{
			toDetail(id) {
				uni.navigateTo({
					url: './modify?id=' + id
				});
			},
			gorise(){
				uni.navigateTo({
					url:'/pages/user/mine/mine-wdtt/mine-wdtt-qy/index',
				})
			}
		}

	}
</script>

<style>
	page {
		width: 100%;
		height: 100%;
		background-color: #e1e5eb;
	}
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		width: 100%;
		height: 100%;
	}
	.indexList {
		width: 100%;
		border-radius: 10px;
	}

	.ad-indexList {
		border: 1px solid #ffffff;
		border-radius: 10px;
		background-color: #FFFFFF;
		margin-top: 5px;
		margin-left: 10px;
		margin-right: 10px;
		padding: 10px;
		box-shadow: 2px 2px 2px #a1a1a1;
	}

	.ad-List {
		font-size: 14px;
	}

	.ad-List-text {
		text-overflow: ellipsis;
		white-space: nowrap;
		overflow: hidden;
		display: flex;
		margin-bottom: 5px;
		width: 90%;
	}

	.list-text-01 {
		margin-left: 10px;
		width: 100%;
		overflow: auto;
	}
	.contenter {
		padding: 10px;
		width: 100%;
	}
	.head{
		
	}
	.ad-head{
		position: fixed;
		height: 45px;
		width: 45px;
		left: 80%;
		top: 80%;
	}
	.ad-head image{
		height: 45px;
		width: 45px;
	}
	.bgimge {
		color: #999999;
		text-align: center;
		justify-content: center;
		align-items: center;
	}
	.bgimge image{
		width: 150px;
		height: 170px;
	}
</style>
